package threading;

import java.util.Scanner;

/*
public class Day9 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int [][] ch = new int[n+1][m+1];
        for(int i = 0;i < n+1;i++){
            ch[i][0] = 1;
        }
        for(int j = 0;j < m+1;j++){
            ch[0][j] = 1;
        }
        for(int i = 1;i < n+1;i++){
            for(int j = 1;j < m+1;j++){
                ch[i][j] = ch[i][j-1] + ch[i-1][j];
            }
        }
        System.out.println(ch[n][m]);
        return ;
    }
}*/
public class Day9 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println(addAB(a,b));
        return;
    }
    public static int addAB(int A, int B) {
        if(A == 0){
            return B;
        }
        if(B == 0){
            return A;
        }
        int a = A ^ B;//异或
        int b = (A & B) << 1;
        return addAB(a,b);
    }
}

